package pers.zcr.meringue.monolithic.demo.testuser.gateway.impl;

import cn.hutool.core.bean.BeanUtil;
import org.springframework.stereotype.Component;
import pers.zcr.meringue.monolithic.demo.testuser.domain.bo.TestUser;
import pers.zcr.meringue.monolithic.demo.testuser.gateway.ITestUserGateway;
import pers.zcr.meringue.monolithic.demo.testuser.gateway.database.dataobject.TestUserPo;
import pers.zcr.meringue.monolithic.demo.testuser.gateway.database.service.ITestUserDataService;
@Component
public class TestUserGatewayImpl implements ITestUserGateway {

    private final ITestUserDataService testUserDataService;
    public TestUserGatewayImpl(ITestUserDataService testUserDataService) {
        this.testUserDataService = testUserDataService;
    }

    @Override
    public TestUser queryById(Long id) {
        TestUserPo testUserPo = testUserDataService.getById(id);
        return BeanUtil.copyProperties(testUserPo, TestUser.class);
    }
}
